<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<%@ page language="java" import="java.sql.*" %>
<%@ page contentType="text/html; charset=UTF-8"%>
<%	String driver = "org.h2.Driver";
	Class.forName(driver).newInstance();
	Connection con=null;
	ResultSet rst=null;
	Statement stmt=null;
	try{
		con=DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
		stmt=con.createStatement();
	}
	catch(Exception e){
		System.out.println(e.getMessage());
	}
	String dousuniecia =request.getParameter("del") ;
	stmt.executeUpdate("delete from dj where id='"+dousuniecia+"';");
	rst=stmt.executeQuery("select * from dj");
		%>
		<html>
		<head>
		<jsp:include page="HEAD.txt"></jsp:include>
		</head>
		<body>
		<jsp:include page="A.txt"></jsp:include>
		<center>
			<h2>Dj's' List</h2>
			<table border="1" cellspacing="0" cellpadding="0">
			<tr>
				<td><b>ID</b></td>
				<td><b>Imie</b></td>
				<td><b>Nazwisko</b></td>
				<td><b>Pseudonim</b></td>
				<td><b>Email</b></td>
				<td><b>Gatunek</b></td>
			</tr>
			 	<%
				int no=1;
				while(rst.next()){
				%>
				<tr>
				  <td><%=no%></td>
				  <td><%=rst.getString("imie")%></td>
				  <td><%=rst.getString("nazwisko")%></td>
				  <td><%=rst.getString("pseudonim")%></td>
				  <td> <%=rst.getString("email")%> </td>
				  <td><%=rst.getString("gatunek")%></td>
				  <td><a href="djDelE.jsp?del=<%=rst.getString("id")%>">Usuń</a></td>
				</tr>
				<%
				no++;
	}
	rst.close();
	stmt.close();
	con.close();
%>
			</table>
			<a href=index.jsp>Powrot</a>
			</center>
			<jsp:include page="Z.txt"></jsp:include>
		</body>
	</html>